package com.zy.dp.iterator.example3;

public class Client
{
	public static void main(String[] args)
	{
		PayManager payManager = new PayManager();
		payManager.calcPay();
		test(payManager.createIterator());
		SalaryManager salaryManager = new SalaryManager();
		salaryManager.calcSalary();
		test(salaryManager.createIterator());

	}

	private static void test(Iterator it)

	{

		it.first();
		while (!it.isDone())
		{
			Object object = it.currentItem();
			System.out.println(object);
			it.next();
		}

	}

}
